package com.ssyx.model.base;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Transient;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Data
public class BaseMongoEntity implements Serializable {
	
	@ApiModelProperty(value = "id")
	@Id
	private String id;
	
	@ApiModelProperty(value = "创建时间")
	@CreatedDate
	private Date createTime;
	
	@ApiModelProperty(value = "更新时间")
	@LastModifiedDate
	private Date updateTime;
	
	@ApiModelProperty(value = "其他参数")
	@Transient //被该注解标注的，将不会被录入到数据库中。只作为普通的javaBean属性
	private Map<String, Object> param = new HashMap<>();
}
